module mux (
    output out,
    input sel, a, b
);
    not(sel_, sel);
    and(selb, sel, b);
    and(sela, sel_, a);
    or(out, selb, sela);
endmodule
